<div class="form_item" style="padding:15px;margin-right: -15px;margin-left: -15px;" id='form_{$form['id']}'>
	<input name="form_id[]" type="hidden" class="form-control form_id" value="{$form['id']}"/>
    <input name="form_fieldstype[{$form['id']}]" type="hidden" class="form-control js-fieldstype" value="{$form['fieldstype']}"/>
    <input name="form_displaytype[{$form['id']}]" type="hidden" class="form-control js-displaytype" value="{$form['displaytype']}"/>
	<div class="form-group" style="margin-bottom:0px;">
		<div class="col-xs-12 col-sm-12 col-lg-12">
        	<div class="input-group">
                <input name="form_title[{$form['id']}]" type="text" class="form-control form_title" value="{$form['title']}" placeholder="{$form['placeholder']}"/>
                <span class="input-group-addon">
                <label class="checkbox-inline">
                    <input type="checkbox" {if $form['essential']==1}checked{/if} value="1" onclick='essentialForm(this)'>必填
                    <input type="hidden" class="form_essential" name="form_essential[{$form['id']}]" VALUE="{$form['essential']}" />
                </label>
                </span>
                <div class="input-group-btn"><button class="btn btn-danger" type="button" onclick="removeForm('{$form['id']}')"><i class="fa fa-remove"></i></button></div>
            </div>
		</div>
	</div>
    {if $form['displaytype']!=='' && strpos('012',$form['displaytype'])!==false}
	<div class="form-group js-child" style="margin-bottom:0px;">
		<div class="col-xs-12 col-sm-10 col-lg-10">
			<div id="form_item_{$form['id']}" class='form_item_items'>
            {if empty($form['items'])}
            	{php $formitem['id']=random(32);$formitem['show']=1;$formitem['placeholder']='输入选项1'}
            	{php include aide_template('activity/form_item')}
                {php $formitem['id']=random(32);$formitem['show']=1;$formitem['placeholder']='输入选项2'}
            	{php include aide_template('activity/form_item')}
            {/if}
			{loop $form['items'] $k $formitem}
            {php $formitem['placeholder']='输入选项'.($k+1);}
			{php include aide_template('activity/form_item')}
			{/loop}
			</div>
		</div>
        <div class="col-xs-12 col-sm-8 col-lg-8">
        <a href="javascript:;" id="add-formitem-{$form['id']}" formid='{$form['id']}' class="btn btn-info add-formitem" onclick="addFormItem('{$form['id']}')"><i class="fa fa-plus"></i> 添加选项</a>
        </div>
	</div>
    {/if}
</div>
